package com.portal.sso.core.model;

import com.portal.sso.core.config.PortalResault;
import lombok.Data;

import java.io.Serializable;
@Data
public class ResponseTModel<T> implements Serializable {
    public static final long serialVersionUID = 42L;

    public static final int SUCCESS_CODE = 200;
    public static final int FAIL_CODE = 500;


    private int code;
    private String msg;
    private T data;

    public ResponseTModel(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public ResponseTModel(PortalResault mo) {
        this.code = mo.code();
        this.msg = mo.desc();
    }
    public ResponseTModel(T data,String msg) {
        this.code = SUCCESS_CODE;
        this.data = data;
        this.msg = msg;
    }

}
